function createAnimation(options) {
  let from = options.from;
  const to = options.to;
  const totalMS = options.totalMS || 1000;
  const duration = options.duration || 15;

  const times = Math.floor(totalMS / duration);
  const dis = (to - from) / times;
  let curTimes = 0;
  let timerId = setInterval(() => {
    from += dis;
    curTimes++;
    if (curTimes >= times) {
      from = to;
      clearInterval(timerId);
      options.onend && options.onend();
      options.onmove && options.onmove(from);
      return;
    }
    options.onmove && options.onmove(from);
  }, times);
}
